import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'element-ui/lib/theme-chalk/display.css';
import App from './App.vue'
import router from './router'
import less from 'less'
import VueBus from 'vue-bus';
import baseurl from './config/config'
import './assets/iconfont/iconfont.css'

Vue.use(VueBus);

Vue.use(less)

Vue.use(ElementUI);

Vue.prototype.BASEURL=baseurl;

Vue.prototype.openLoading = function() {
  const loading = this.$loading({           // 声明一个loading对象
    lock: true,                             // 是否锁屏
    text: '正在加载...',                     // 加载动画的文字
    spinner: 'el-icon-loading',             // 引入的loading图标
    background: 'rgba(0, 0, 0, 0.3)',       // 背景颜色
    target: '.sub-main',                    // 需要遮罩的区域
    body: true,                              
    customClass: 'mask'                     // 遮罩层新增类名
  })
  return loading;
}

var echarts = require('echarts')
Vue.prototype.$echart = echarts 

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
